home *** CD-ROM | disk | FTP | other *** search
/ Sprite 1984 - 1993 / Sprite 1984 - 1993.iso / src / X11R4 / cmds / X / ddx / sprite.X11R3 / hdr / pixfont.h < prev    next >
Encoding:
C/C++ Source or Header  |  1989-11-03  |  1.6 KB  |  57 lines

  1. /*    @(#)pixfont.h 1.14 88/02/08 SMI    */
  2.  
  3. /*
  4.  * Copyright (c) 1986 by Sun Microsystems, Inc.
  5.  */
  6.  
  7. #ifndef    pixfont_DEFINED
  8. #define    pixfont_DEFINED
  9.  
  10. /*
  11.  * Definition of pixfonts for pixrect library.
  12.  * Include <pixrect/pixrect.h> before this file.
  13.  */
  14.  
  15. /*
  16.  * A character descriptor contains the pixrect constituting the actual
  17.  * character, the coordinates of the home (top left) of that pixrect
  18.  * relative to the character origin (a point on the baseline near the left
  19.  * of the character), and the distance by which to advance the origin after
  20.  * printing this character.
  21.  */
  22. struct pixchar {
  23.     Pixrect *pc_pr;       /* pixrect for this char */
  24.     struct pr_pos pc_home;       /* home coords relative to left baseline */
  25.     struct pr_pos pc_adv;       /* distance to next char */
  26. };
  27.  
  28. /*
  29.  * A font descriptor contains the width of a space (intended to be used
  30.  * in computing backspace and tab distances), the distance between consecutive
  31.  * baselines in the absence of any superscripting, subscripting, or similar
  32.  * vertical monkey business, and an array of 256 character descriptors.
  33.  */
  34. typedef struct pixfont {
  35.     struct pr_size pf_defaultsize;    /* default character size */
  36.     struct pixchar pf_char[256];
  37. } Pixfont;
  38.  
  39. /* structured text macros */
  40. #ifndef lint
  41. #define    prs_text(prpos, op, pf, str) \
  42.     pr_text((prpos).pr, (prpos).pos.x, (prpos).pos.y, pf, str)
  43.  
  44. #define    prs_ttext(prpos, op, pf, str) \
  45.     pr_ttext((prpos).pr, (prpos).pos.x, (prpos).pos.y, pf, str)
  46. #endif lint
  47.  
  48. Pixfont    *pf_open();
  49. Pixfont    *pf_open_private();
  50. Pixfont    *pf_default();
  51. struct    pr_size pf_textbatch();
  52. struct    pr_size pf_textwidth();
  53.  
  54. #define    PIXFONT    Pixfont
  55.  
  56. #endif    pixfont_DEFINED
  57.